﻿using AccessControl.Sida.Business;
using AccessControl.Sida.Common;
using AccessControl.Sida.FingerPrintCollector.Report;
using AccessControl.Utility.Report;


namespace AccessControl.Sida.FingerPrintCollector.ReportBuilder
{
    public partial class TextReportBuilderExamCard : TextReportBuilder
    {
		private readonly  ExamReportBusiness _examReportBusiness= new ExamReportBusiness();
    	private readonly string _stcode;
        
		public TextReportBuilderExamCard(string stcode) : base(false)
        {
			_stcode = stcode;
            InitializeComponent();
			
        }

		protected override void CreateTextReport()
		{
			var sidaDS = new SidaDS();

			var examCardDataTable = _examReportBusiness.SelectReportByStudent(_stcode);
			if (examCardDataTable != null)
			{
				sidaDS.ExamCard.Merge(examCardDataTable);
			}

			Report = new XtraReportExamCard(sidaDS);

			base.CreateTextReport();
		}
    }
}
